Optimize the interface of `Registry`.
authorAlex Crichton <alex@alexcrichton.com>
Fri, 2 Jun 2017 05:33:02 +0000 (22:33 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 5 Jun 2017 14:36:44 +0000 (07:36 -0700)
commit842c182e67a3b380d0fd70b7d41d3755d6643977
treea23a1c54062b003c1dde3b576b758e901ba181ba
parent337359afdf0a561eaa5826a4e09df5aa8b78a99f
Optimize the interface of `Registry`.

Previously all intermediate stages would create and return `Vec<Summary>`, but
this is a pretty costly operation once you start layering. Ideally we'd use an
iterator-based approach here but working with that in trait objects is
difficult, so this commit takes a closure-based approach to avoid all the
intermediate allocations that are thrown away.
src/cargo/core/registry.rs
src/cargo/core/resolver/mod.rs
src/cargo/ops/cargo_install.rs
src/cargo/sources/directory.rs
src/cargo/sources/git/source.rs
src/cargo/sources/path.rs
src/cargo/sources/registry/index.rs
src/cargo/sources/registry/mod.rs
src/cargo/sources/replaced.rs